#include "mygroupbox.h"
#include<QDebug>

MyGroupBox::MyGroupBox(QWidget *parent):
		QGroupBox(parent)
{
}
void MyGroupBox::mousePressEvent(QMouseEvent *event)
{
	this->startPos = event->globalPos();
	this->endPos = this->pos();
}

void MyGroupBox::mouseMoveEvent(QMouseEvent *event)
{
	if(event->buttons()!=Qt::LeftButton) return;
	QPoint movePos = this->endPos+event->globalPos()- this->startPos;
	if( movePos.x()<=-50 || movePos.x()>=70 || movePos.y()<=0 || movePos.y()>=350)
		return;
		this->move(movePos);
}
